package com.java.grammer.arrays;

/**
 * 数组查找
 */
public class Array_Test6 {
    public static void main(String[] args) {
        int[] a = {5, 9, 1, 5, 6, 4, 5, 1, 8};
        int b = 5;
        boolean isFlag = true;
        for (int i = 0; i < a.length; i++) {
            if (a[i] == b) {
                System.out.println("找到了这个数的索引值为：" + i);
                isFlag = false;
                break;
            }
        }
        if (isFlag == true) {
            System.out.println("没找到");
        }
    }
}